<%--
 *  File:    error.jsp 
 *  @Author: langerwang 
 *  Date:    2001/11/08
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>

<%@ page language="java" %>  
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
	String strModuleName = "UPM";
	Category cat = Category.getInstance("jsp.error");
%>

<%@ include file="/inc/PageDefault.inc" %>

<%
	OvalCustomTable table = new OvalCustomTable(strLanguageCode, "");
	Vector errorCode = (Vector)session.getAttribute("errorcode");
  	cat.info(errorCode);
  	if(errorCode == null || errorCode.size() == 0)
  	{
    	errorCode = new Vector();
    }
%>
<script language="javascript">
if(opener!=null)
{
  opener.location.href="SessionError.jsp?<%= OvalTools.randomURL() %>";
  window.close();
  
}

if(window.name!="content"   )
{
	top.content.location.href="SessionError.jsp?<%= OvalTools.randomURL() %>";
	
}
</script>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="./css/<%= strLanguageCode %>/main.css" type="text/css">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td > 
      <div align="center"><br>
        <br>
        <table border="0" cellspacing="0" cellpadding="7" width="434" height="271">
          <tr> 
            <td background="./images/<%= strLanguageCode %>/Error_bg.gif" valign="top"> 
              <table width="100%" border="0" height="100%" cellspacing="0" cellpadding="0">
                <tr> 
                  <td valign="top"> 
                    <p>&nbsp;</p>
                    <table width="95%" border="0" align="center" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td width="35"><img src="./images/<%= strLanguageCode %>/Error.gif"> 
                        </td>
                        <td class="error_title"><%= label.getLabelName("L_ErrorMsg") %></td>
                      </tr>
                      
                      <% 
                      	cat.debug("errorCode->" + errorCode.size());
						for(int i=0;i<errorCode.size();i++)
  						{
  							cat.debug("er->");
  							HashMap err = (HashMap)errorCode.elementAt(i);
  							String messageCode = (String)err.get("messagecode");
  							String messageContent = message.getMessage(messageCode);
  							cat.debug("messageCode->" + messageCode);
  							cat.debug("messageContent->" + messageContent);
  							int index = 0;
  							for(int j=0;(index=messageContent.indexOf("%s"))!=-1;j++)
  								messageContent = messageContent.substring(0, index) + 
  												 table.getTable((String)err.get("param" + (j+1))) +
  												 messageContent.substring(index+3);  					    
  							
  						%>
  						<tr><td>&nbsp;</td><td><% if(errorCode.size() > 1){%><%=JspHelper.filterNull( i+1 )%><%=JspHelper.filterNull( "." )%><%}%><%=JspHelper.filterNull( messageContent )%></td></tr>
  					<% }
  					   if(errorCode.size() == 0)
  					   {
  					 %>  
  						<tr><td>&nbsp;</td><td><%= message.getMessageDesc("U_DEFAULT") %></td></tr>
  					<% } %>
                      
                    </table>
                    <p>&nbsp;</p>
                  </td>
                </tr>
                <tr> 
                  <td height="1" class="td_center"><a onclick="top.location.href='<%= ConstantProp.DEFAULT_ROOT_PATH %>/HomePage.jsp?<%= OvalTools.randomURL() %>';"><custom:button type="1" label="L_Back" imgsrc="back.gif" border="0" style="width:60"/></a></td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
  </div>
    </td>
  </tr>
</table>

</body>
</html>


















